<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: PRM</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: PRM</td>
      <td class="subheader-left"><a href="matlab:open PRM">View code for PRM</a></td>
    </tr>
  </table>
<h1>PRM</h1><p><span class="helptopic">Probabilistic RoadMap navigation class</span></p><p>
A concrete subclass of the abstract Navigation class that implements the
probabilistic roadmap navigation algorithm over an occupancy grid.  This
performs goal independent planning of roadmaps, and at the query stage
finds paths between specific start and goal points.

</p>
<h2>Methods</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> PRM</td> <td>Constructor</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> plan</td> <td>Compute the roadmap</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> query</td> <td>Find a path</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> plot</td> <td>Display the obstacle map</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> display</td> <td>Display the parameters in human readable form</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> char</td> <td>Convert to string</td></tr>
</table>
<h2>Example</h2>
<pre style="width: 90%%;" class="examples">
load&nbsp;map1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;load&nbsp;map
goal&nbsp;=&nbsp;[50,30];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;goal&nbsp;point
start&nbsp;=&nbsp;[20,&nbsp;10];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;start&nbsp;point
prm&nbsp;=&nbsp;PRM(map);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;create&nbsp;navigation&nbsp;object
prm.plan()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;create&nbsp;roadmaps
prm.query(start,&nbsp;goal)&nbsp;&nbsp;%&nbsp;animate&nbsp;path&nbsp;from&nbsp;this&nbsp;start&nbsp;location
</pre>
<h2>References</h2>
<ul>
  <li>Probabilistic roadmaps for path planning in high dimensional configuration spaces,
L. Kavraki, P. Svestka, J. Latombe, and M. Overmars,
IEEE Transactions on Robotics and Automation, vol. 12, pp. 566-580, Aug 1996.</li>
  <li>Robotics, Vision & Control, Section 5.2.4,
P. Corke, Springer 2011.</li>
</ul>
<h2>See also</h2>
<p>
<a href="Navigation.html">Navigation</a>, <a href="DXform.html">DXform</a>, <a href="Dstar.html">Dstar</a>, <a href="PGraph.html">PGraph</a></p>
<hr>
<a name="PRM"><h1>PRM.PRM</h1></a>
<p><span class="helptopic">Create a PRM navigation object</span></p><p>
<strong>p</strong> = <span style="color:red">PRM</span>(<strong>map</strong>, <strong>options</strong>) is a probabilistic roadmap navigation
object, and <strong>map</strong> is an occupancy grid, a representation of a
planar world as a matrix whose elements are 0 (free space) or 1
(occupied).

</p>
<h2>Options</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1">'npoints', N</td> <td>Number of sample points (default 100)</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'distthresh', D</td> <td>Distance threshold, edges only connect vertices closer
than D (default 0.3 max(size(occgrid)))</td></tr>
</table>
<p>
Other <strong>options</strong> are supported by the Navigation superclass.

</p>
<h2>See also</h2>
<p>
<a href="Navigation.Navigation.html">Navigation.Navigation</a></p>
<hr>
<a name="char"><h1>PRM.char</h1></a>
<p><span class="helptopic">Convert to string</span></p><p>
P.<span style="color:red">char</span>() is a string representing the state of the <span style="color:red">PRM</span>
object in human-readable form.

</p>
<h2>See also</h2>
<p>
<a href="PRM.display.html">PRM.display</a></p>
<hr>
<a name="plan"><h1>PRM.plan</h1></a>
<p><span class="helptopic">Create a probabilistic roadmap</span></p><p>
P.<span style="color:red">plan</span>(<strong>options</strong>) creates the probabilistic roadmap by randomly
sampling the free space in the map and building a graph with
edges connecting close points.  The resulting graph is kept
within the object.

</p>
<h2>Options</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1">'npoints', N</td> <td>Number of sample points (default is set by constructor)</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'distthresh', D</td> <td>Distance threshold, edges only connect vertices closer
than D (default set by constructor)</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'movie', M</td> <td>make a movie of the PRM planning</td></tr>
</table>
<hr>
<a name="plot"><h1>PRM.plot</h1></a>
<p><span class="helptopic">Visualize navigation environment</span></p><p>
P.<span style="color:red">plot</span>() displays the roadmap and the occupancy grid.

</p>
<h2>Options</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> 'goal'</td> <td>Superimpose the goal position if set</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'nooverlay'</td> <td>Don't overlay the PRM graph</td></tr>
</table>
<h2>Notes</h2>
<ul>
  <li>If a query has been made then the path will be shown.</li>
  <li>Goal and start locations are kept within the object.</li>
</ul>
<hr>
<a name="query"><h1>PRM.query</h1></a>
<p><span class="helptopic">Find a path between two points</span></p><p>
P.<span style="color:red">query</span>(<strong>start</strong>, <strong>goal</strong>) finds a path (Mx2) from <strong>start</strong> to <strong>goal</strong>.

</p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2014 Peter Corke.</p>
</body></html>